package com.fjwt.gz.proxy.ctrl.merchant;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fjwt.gz.core.model.ApiRes;
import com.fjwt.gz.db.vo.MchChannelVO;
import com.fjwt.gz.proxy.ctrl.CommonCtrl;
import com.fjwt.gz.service.impl.MchChannelService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/api/mchChannel")
public class MchChannelController extends CommonCtrl {
    @Autowired
    private MchChannelService mchChannelService;
    /**
     * 商户进件商户三方间联号表列表
     */
    @PreAuthorize("hasAuthority('ENT_MCH_INFO_VIEW')")
    @PostMapping("/list")
    public ApiRes list() {
        String mchNo = getValString("mchNo");
        String ifName = getValString("ifName");
        log.info("pc端商户进件商户三方间联号表列表查询条件，请求地址：/api/mchChannel，请求参数：mchNo：{}，ifName：{}", mchNo, ifName);
        IPage<MchChannelVO> pages = mchChannelService.queryMchChannelList(getIPage(),mchNo,ifName);
        log.info("pc端商户进件商户三方间联号表列表查询条件，请求地址：/api/mchChannel，返回结果：{}", pages);
        return ApiRes.page(pages);
    }
}
